package cs3343.project.family;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class Dice {
	
	static JLabel[] diceImg = new JLabel[7]; 
		
	public static void createDice() {
		for(int i = 0; i < 7; i++) {
			diceImg[i] = new JLabel(new ImageIcon(ConfigManager.IMAGE_PATH + "dice_" + Integer.toString(i) + ".gif"));
			diceImg[i].setBounds(300, 250, 100, 100);
			diceImg[i].setVisible(false);
			InitGame.gamePanel.add(Dice.diceImg[i]);
		}
		
		diceImg[0].setVisible(true);
		
	}
	
	public int rollDice(int high, int low) {
		return (int) (Math.random() * (high - low) + low + 1);
	}
	
	public static void setDiceImage(int diceNum) {
		for(int i = 0; i < 7; i++)
			diceImg[i].setVisible(false);
		
		diceImg[diceNum].setVisible(true);
	}
}
